package persistence;

import core.Product;

/**
 * The data transfer object for products
 * @author Sabrina
 *
 */
public class ProductDTO 
{
	private String _barcode;
	private String _description;
	private float _sizeValue;
	private String _sizeUnit;
	private int _shelfLife;
	private int _threeMoSupply;
	
	/**
	 * Construct the ProductDTO object
	 * @param prod the product associated with ProductDTO
	 */
	public ProductDTO(Product prod)
	{
		_barcode = prod.getBarcode().toString();
		_description = prod.getDescription();
		_sizeValue = prod.getQuantityForOneUnit();
		_sizeUnit = prod.getUnitOfMeasurement();
		_shelfLife = prod.getShelfLife();
		_threeMoSupply = prod.getThreeMonthSupply();
	}
	
	/**
	 * get the barcode for the product associated with the DTO
	 * @return the barcode
	 */
	public String getProductBarcode()
	{
		return _barcode;
	}
	
	/**
	 * get the description for the product associated with the DTO
	 * @return the description
	 */
	public String getDescription()
	{
		return _description;
	}
	
	/**
	 * get the value of the size of the associated product
	 * @return the size's value
	 */
	public float getSizeValue()
	{
		return _sizeValue;
	}
	
	/**
	 * Get the unit of the size of the associated product
	 * @return the size's unit
	 */
	public String getSizeUnit()
	{
		return _sizeUnit;
	}
	
	/**
	 * get the shelf-life of the associated product
	 * @return the product's shelf-life
	 */
	public int getShelfLife()
	{
		return _shelfLife;
	}
	
	/**
	 * Get the 3-month supply of the associated product
	 * @return the product's 3-month supply
	 */
	public int getThreeMonthSupply()
	{
		return _threeMoSupply;
	}
}
